package io.gitee.cofenghen.jdbctempleplus.core;

import io.gitee.cofenghen.jdbctempleplus.BaseJdbcTemplePlus;
import io.gitee.cofenghen.jdbctempleplus.exception.OrmException;
import io.gitee.cofenghen.jdbctempleplus.support.QueryCondition;

import java.util.List;

public interface Repository<T> {

    BaseJdbcTemplePlus ado();

    /**
     * @param entity
     * @param <T>
     * @return
     */
    <T> int insert(T entity) throws OrmException;



    <T>  int batchInsert(List<T> entities) throws OrmException;



    T queryById( Object id) throws OrmException;

    List<T> query(QueryCondition<T> queryCondition);

    <T> int updateById(Object id, T entity);

    <T> int deleteById( Object id);
}
